
MNT_MTD = mnt/mtd
MNT_LOGO = mnt/logo

$(MNT_MTD): $(shell find $(OUTPUT_CFG)/config/etc/ppp 2>/dev/null)
	@$(MKDIR) -p mnt/mtd/etc/
	@$(CP) $(OUTPUT_CFG)/config/etc/ppp mnt/mtd/etc/ -Rf

$(MNT_LOGO)/$(GUI_LANG_TAR_NAME): $(GUI_LANG_TAR)
	@$(MKDIR) -p $(MNT_LOGO)
	@$(CP) $(GUI_LANG_TAR) $(MNT_LOGO)/$(GUI_LANG_TAR_NAME)

$(TAR_BIN_WITH_HEADER): $(MNT_MTD) $(MNT_LOGO)/$(GUI_LANG_TAR_NAME) $(shell find $(MNT_MTD) 2>/dev/null)
	@$(ECHO) [$@] Changed file:$?
	$(UPGRADE_MAKER) $(UM_ARCHIVE) $(MNT_MTD) $(MNT_LOGO)/$(GUI_LANG_TAR_NAME)
	mv $(UPGRADE_MAKER_OUTPUT_NAME) $@

usr.hbgk.bin: $(OUTPUT_HB_BK)/$(USR_CRAMFS_NAME) key 
	@$(ECHO) [$@] Changed file:$?
	$(UPGRADE_MAKER) $(UM_USR_FS) $(USR_CRAMFS_NAME)
	mv $(UPGRADE_MAKER_OUTPUT_NAME) $@

$(USR_CRAMFS_NAME): $(shell find $(OUTPUT_USR_FS) 2>/dev/null)
	$(MK_CRAMFS) $(OUTPUT_USR_FS) $@

$(WEB_CRAMFS_NAME): $(shell find $(OUTPUT_WEB_FS) 2>/dev/null)
	@$(ECHO) [$@] Changed file:$?
	$(MK_CRAMFS) $(OUTPUT_WEB_FS) $@

JFFS2_ERASE_SIZE	= 0x10000
logo.hbgk.jffs2: $(CFG_DIR_NAME)/logo/key $(GUI_LANG_TAR) $(shell find $(OUTPUT_CFG)/logo 2>/dev/null)
	@$(ECHO) [$@] Changed file:$?
	$(MK_JFFS2) -d $(CFG_DIR_NAME)/logo -l -e $(JFFS2_ERASE_SIZE) -o $@ 

cfg.hbgk.jffs2: $(shell find $(OUTPUT_CFG)/config 2>/dev/null)
	@$(ECHO) [$@] Changed file:$?
	$(MK_JFFS2) -d $(CFG_DIR_NAME)/config -l -e $(JFFS2_ERASE_SIZE) -o $@

# vim:noet:sw=4:ts=4

